package com.study.service;

import com.study.common.annotation.MyReference;
import com.study.vo.MyChildVo;
import com.study.vo.TestVO;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @包名称 com.study.service
 * @类描述 <pre></pre>
 * @作者 zhangbo
 * @创建时间 2020/5/31.
 * @版本 1.00
 * @修改记录 <pre>
 *     版本           修改人         修改日期         修改内容描述
 *     -----------------------------------------------------------
 *     1.00           zhangbo        2020/5/31.           类创建
 *     -----------------------------------------------------------
 * </pre>
 */
@Service
public class TestService {

    @MyReference(retrys = 1)
    private ITestService testService;

    public String test() {
        return testService.hello("zhangsan", 19);
    }


    public Object test2() {
        TestVO testVO = new TestVO();
        testVO.setName("zhangsan");
        testVO.setAge(30);
        testVO.setNowTime(LocalDateTime.now());
        List<MyChildVo> childs = new ArrayList<>(2);
        MyChildVo child = new MyChildVo();
        child.setChildName("小小");
        child.setChildAge(10);
        childs.add(child);

        child = new MyChildVo();
        child.setChildName("大大");
        child.setChildAge(20);
        childs.add(child);

        testVO.setChildVoList(childs);
        return testService.testDto(testVO);
    }

    public void test3() {
        testService.test();
    }
}
